package com.zzl.bonds.ticket.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zzl.apidoc.annotation.ApidocModel;
import com.zzl.apidoc.annotation.ApidocModelProperty;
import com.zzl.bonds.ticket.constant.status.SignerStateEnum;
import lombok.Data;
import net.minidev.json.annotate.JsonIgnore;

import java.io.Serializable;
import java.util.Date;

/**
 * 电子合同表
 *
 * @author gull
 * @date 2022-07-06 13:43:52
 */
@Data
@TableName("t_business_contract")
@ApidocModel
@SuppressWarnings("javadoc")
public class BusinessContractEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.UUID)
    @ApidocModelProperty(description = "主键")
    private String id;
    @ApidocModelProperty(description = "业务数据表主键")
    private String businessId;
    @ApidocModelProperty(description = "业务类型，1凭证开具，2凭证签收，3转让，4转让签收，5融资")
    private Integer businessType;
    @ApidocModelProperty(description = "电子合同id")
    private String contractId;
    @ApidocModelProperty(description = "文件名称")
    private String contractName;
    @ApidocModelProperty(description = "合同编号")
    private String contractNo;
    @ApidocModelProperty(description = "合同状态：未完成0 已完成1 已拒绝2 正在签署3 锁定待签4 已过期9")
    private Integer contractStatus;
    @TableField(exist = false)
    @ApidocModelProperty(description = "签署状态：未签署	0已签署	1已拒绝	2锁定待签	3（用户用本地证书签署时使用，本项目用不到）抄送	9")
    private Integer signmentState;
    @TableField(exist = false)
    @ApidocModelProperty(description = "签署状态：未签署	0已签署	1已拒绝	2锁定待签	3（用户用本地证书签署时使用，本项目用不到）抄送	9")
    private String signmentStateName;

    public String getSignmentStateName() {
        if (null == signmentState) {
            return "";
        }
        return SignerStateEnum.getValue(signmentState);
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApidocModelProperty(description = "创建时间", validate = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApidocModelProperty(description = "修改时间", validate = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    @ApidocModelProperty(description = "创建人")
    private Integer creatorId;
    @ApidocModelProperty(description = "修改人")
    private Integer updaterId;
    @ApidocModelProperty(description = "备注")
    private String remark;
    @ApidocModelProperty(description = "1 表示删除，0 表示未删除")
    @TableField(value = "is_deleted")
    @TableLogic(value = "0", delval = "1")
    private Integer deletedStatus;
    @ApidocModelProperty(description = "企业id/通讯录的 企业id")
    private String enterpriseId;
    @ApidocModelProperty(description = "合同摘要")
    private String contractSummary;

}
